'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	const db =uniCloud.database()
	return new Promise((resolve,reject)=>{
		db.collection("FriendInfo").doc(event._id).update({
			"UserAccount":event.UserAccount,
			"friendName":event.friendName,
			"friendSex":event.friendSex,
			"friendBirthday":event.friendBirthday,
			"friendTel":event.friendTel,
			"friendRelation":event.friendRelation,
			"UserImg":event.UserImg
		}).then(res=>{
			resolve(res)
		}).catch(err=>{
			reject(err)
		})
	})
	
	//返回数据给客户端
	return event
};
